from typing import Callable


class ProgressHelper(object):
    def __init__(self, on_progress: Callable[[int, int, str], None], max_progress: int):
        self.on_progress = on_progress
        self.i_cur = 0
        self.i_max = max_progress

    def on_message(self, msg: str):
        self.on_progress(self.i_cur, self.i_max, msg)
        return self

    def inc(self):
        self.i_cur += 1
        return self

    def get_cur(self) -> int:
        return self.i_cur

    def set_cur(self, i_cur: int):
        self.i_cur = i_cur

    def get_max(self) -> int:
        return self.i_max

    def set_max(self, i_max: int):
        self.i_max = i_max
